#ifndef SEGMENT_MODELIZER_OPERATOR_HPP
#define SEGMENT_MODELIZER_OPERATOR_HPP

//------------------------------------------------------------------------------
// Fichier d'entête utilisés
//------------------------------------------------------------------------------
#include "Operator.hpp"
#include "SegmentContainer.hpp"
#include "Outline.hpp"
#include "SegmentContainer.hpp"
#include "OutlineContainer.hpp"

namespace ImageAnalysis
{

//----------------------------------------------------------------------
//
//----------------------------------------------------------------------
class SegmentModelizerOperator : public Operator
{
public:
		//----------------------------------------------------------------------
		// Structure
		//----------------------------------------------------------------------
		
		typedef std::list<SegmentContainer*>::iterator TSegmentContainerListIterator;
		typedef std::list<SegmentContainer*> TSegmentContainerList;

		//----------------------------------------------------------------------
		// Constructeur
		//----------------------------------------------------------------------
		SegmentModelizerOperator( OutlineContainer* _outlineList, TSegmentContainerList* _outlinesSegmentsList );
		
		//----------------------------------------------------------------------
		// Destructeur
		//----------------------------------------------------------------------
		virtual ~SegmentModelizerOperator();
		
		//----------------------------------------------------------------------
		// Méthode 
		//----------------------------------------------------------------------
		virtual void Process( );
	
private:
		//----------------------------------------------------------------------
		//
		//----------------------------------------------------------------------
		OutlineContainer* outlineList;
		TSegmentContainerList* outlinesSegmentsList;
		int width;
		int height;

		//----------------------------------------------------------------------
		// Constructeur par copie et oprérateur d'affectation en privée pour
		// interdire leur utilisation
		//----------------------------------------------------------------------
		SegmentModelizerOperator( const SegmentModelizerOperator& copy);
		SegmentModelizerOperator & operator=( const SegmentModelizerOperator& copy );
		
		void findSegments(Outline::TOutlineIterator itBegin, Outline::TOutlineIterator itEnd, SegmentContainer * segments);
		SegmentContainer::Coordinates * getCoordinates (Outline::TOutlineIterator it);
		float ComputeDistance (Outline::TOutlineIterator itBegin,Outline::TOutlineIterator itMiddle,Outline::TOutlineIterator itEnd);
};

}

#endif //SEGMENT_MODELIZER_OPERATOR_HPP
